package cn.doitedu.demo10;

import cn.doitedu.pojo.UserEvent;
import org.apache.flink.api.common.functions.RuntimeContext;
import org.apache.flink.util.Collector;
import org.roaringbitmap.longlong.Roaring64Bitmap;

import java.io.IOException;

public interface RuleCalculator {


    /**
     * 交给运算机实现类，去实现一些自己所需的初始化逻辑
     * @param runtimeContext
     */
    void init(RuntimeContext runtimeContext,
              String ruleParamJson,
              Roaring64Bitmap preSelectUsersBitmap,
              Long webCalcEndTime) throws IOException;

    /**
     * 交给运算机实现类，去实现自己的数据处理逻辑
     * @param eventBean
     * @param out
     */
    void calc(UserEvent eventBean, Collector<String> out) throws IOException;
}
